#pragma once
#include "RBTree.h"

namespace xyx
{
	template<class K>
	class set
	{	
		struct SetKeyOfT
		{
			const K& operator()(const K& key)
			{
				return key;
			}
		};
	public:
		typedef typename RBTree<K, K, SetKeyOfT>::const_iterator iterator;
		typedef typename RBTree<K, K, SetKeyOfT>::const_iterator const_iterator;

		const_iterator begin() const
		{
			return _tree.begin();
		}

		const_iterator end() const
		{
			return _tree.end();
		}

		pair<iterator, bool> insert(const K& key)
		{
			pair<typename RBTree<K, K, SetKeyOfT>::iterator, bool> p = _tree.Insert(key);
			return pair<iterator, bool>(p.first, p.second);
		}

	
	private:
		RBTree<K, K, SetKeyOfT> _tree;
	};
}